package org.ehe.finance.voucher.domain.bo;

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;

import java.math.BigDecimal;
import java.util.List;

/**
 * 记账凭证明细更新业务对象
 * @author :zhangnn
 * @className :VoucherDetailUpdateBo
 * @description: TODO
 * @date 2025-08-25 13:17:56
 */
@Data
public class VoucherDetailUpdateBo {

    @Schema(description = "明细ID")
    @NotNull(message = "明细ID不能为空")
    private Long id;

    @Schema(description = "分录号")
    @NotNull(message = "分录号不能为空")
    @Min(value = 1, message = "分录号必须大于0")
    private Integer entryNo;

    @Schema(description = "会计科目ID")
    @NotNull(message = "会计科目不能为空")
    private Long subjectId;

    @Schema(description = "摘要")
    @Size(max = 255, message = "摘要长度不能超过255个字符")
    private String abstractInfo;

    @Schema(description = "借方金额")
    @DecimalMin(value = "0.00", message = "借方金额不能小于0")
    private BigDecimal debitAmount;

    @Schema(description = "贷方金额")
    @DecimalMin(value = "0.00", message = "贷方金额不能小于0")
    private BigDecimal creditAmount;

    @Schema(description = "客户ID(辅助核算)")
    private Long customerId;

    @Schema(description = "供应商ID(辅助核算)")
    private Long supplierId;

    @Schema(description = "员工ID(辅助核算)")
    private Long employeeId;

    @Schema(description = "项目ID(辅助核算)")
    private Long projectId;

    @Schema(description = "部门ID(辅助核算)")
    private Long departmentId;

    @Schema(description = "币种ID")
    private Long currencyId;

    @Schema(description = "汇率")
    @DecimalMin(value = "0.0001", message = "汇率必须大于0")
    private BigDecimal exchangeRate;

    @Schema(description = "外币借方金额")
    @DecimalMin(value = "0.00", message = "外币借方金额不能小于0")
    private BigDecimal foreignDebit;

    @Schema(description = "外币贷方金额")
    @DecimalMin(value = "0.00", message = "外币贷方金额不能小于0")
    private BigDecimal foreignCredit;


}
